package com.jcli.jb51_net.article._44733按钮点击切换;

import javax.swing.*;
import java.awt.*;

/**
 * java swing编程入门代码编写(java编程入门)
 * https://www.jb51.net/article/44733.htm
 * @ClassName Demo10XOGame
 * @Description TODO
 * @Author li
 * @Data 2023/12/13 20:30
 * @Version 1.0
 */
public class Demo10XOGame extends JFrame {
   JPanel jp = new JPanel();

    public Demo10XOGame() {
       Container x = this.getContentPane();
       x.add(jp);
       jp.setLayout(new GridLayout(3,3));
        for (int i = 0; i < 9; i++) {
            XOButton jb = new XOButton();
            jp.add(jb);
        }

        this.setSize(500,500);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setLocationRelativeTo(null);
        this.setVisible(true);
    }

    public static void main(String[] args) {
        new Demo10XOGame();
    }
}
